using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class Rx_MedicationMap : EntityTypeConfiguration<Rx_Medication>
    {
        public Rx_MedicationMap()
        {
            // Primary Key
            this.HasKey(t => t.id);

            // Properties
            this.Property(t => t.Name)
                .HasMaxLength(50);

            this.Property(t => t.Generic)
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("Rx_Medication");
            this.Property(t => t.id).HasColumnName("id");
            this.Property(t => t.Name).HasColumnName("Name");
            this.Property(t => t.Generic).HasColumnName("Generic");
            this.Property(t => t.Route).HasColumnName("Route");
            this.Property(t => t.Form).HasColumnName("Form");
            this.Property(t => t.Frequency).HasColumnName("Frequency");
            this.Property(t => t.Instruction).HasColumnName("Instruction");
            this.Property(t => t.Strength).HasColumnName("Strength");
            this.Property(t => t.DispenseTime).HasColumnName("DispenseTime");
            this.Property(t => t.Duration).HasColumnName("Duration");
            this.Property(t => t.Refills).HasColumnName("Refills");
            this.Property(t => t.UOM).HasColumnName("UOM");
            this.Property(t => t.Category).HasColumnName("Category");
            this.Property(t => t.Qty).HasColumnName("Qty");
        }
    }
}
